<?php
// 用户本领排序界面

// 标题栏
$tittleText = '修改本领排序';
require("$CfgPara->root/view/tittle_back_bar_blue.app.v.php");
?>
<script src="/tools/Sortable/Sortable.min.js"></script>
<ul id="user_field_manage_list" class="am-list" style="margin-top:-1px; touch-action: none">
    <?php $i = 1;
    foreach ($userFields as $field) { ?>
        <li style="padding: 15px 20px" data-id="<?= $field->Id ?>">
            <div style="display: inline-block">
                <b class="app-gray2-color"><?= $i ?>&nbsp;&nbsp;&nbsp;</b>
                <b class="<?php if ($field->ViewState == 1) echo 'app-main-color'; else echo 'app-gray-color' ?>">
                    <?= $field->FieldName2 ?>
                </b>
            </div>
            <div class="am-fr app-gray-color">
                <a onclick="user_field_order_up(this)" class="am-icon-arrow-up" style="margin-right: 30px"></a>
                <a onclick="user_field_order_down(this)" class="am-icon-arrow-down"></a>
            </div>
        </li>
        <?php $i++;
    } ?>
</ul>
<?php
// 底部按钮
require("$CfgPara->root/view/user_field_order_bottom_bar.app.v.php");
?>
<script>
    var list = document.getElementById("user_field_manage_list");
    sort = Sortable.create(list, {
        onUpdate: user_field_order_en
    });
</script>
